$('#home').live("pageinit", function(event) {
	doLogIn();
});


function doLogIn(){
	$.ajax( { 
		url: "/api/user?continue=/index.html",
		async: false,
		dataType:"json",
		success: function(data) { 
			if(data.result == null) {
				window.location.replace(data.link);
			}
		},
		error: function() {
			console.log("Error: Can not load json object");
		}
	});
}